package com.ruoyi.web.controller.member.mapper;

import com.ruoyi.common.core.dao.BaseMapper;
import com.ruoyi.common.entity.DO.member.MemberDO;
import com.ruoyi.common.entity.VO.member.MemberExportVO;
import com.ruoyi.common.entity.VO.member.MemberSearchVO;
import com.ruoyi.common.entity.VO.member.MemberVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;
import java.util.List;

public interface IBackMemberMapper extends BaseMapper<MemberDO> {

    List<MemberVO> searchList(MemberSearchVO memberSearchVO);

    List<MemberDO> searchListByIdStr(@Param("memberIdStr") String memberIdStr );

    List<MemberExportVO> searchMemberExportList(MemberSearchVO memberSearchVO);

    int multiUpdate(MemberVO memberVO);

    @Select("SELECT DISTINCT phone from member where id in (#{memberIdStr})")
    List<String> searchPhoneList(@Param("memberIdStr") String memberIdStr);

    @Select("SELECT SUM(balance) FROM member where shop_id=#{shopId}")
    BigDecimal sumTotalBalance(Long shopId);
}
